/**
 * 用户交互相关类型定义
 */

// 标签信息
export interface ArticleTag {
  id: number;
  name: string;
  color?: string;
}

// 通用文章卡片数据接口
export interface ArticleCardItem {
  articleId: number;
  title: string;
  summary: string;
  coverImage?: string;
  authorName?: string;
  authorAvatar?: string;
  viewCount?: number;
  likeCount?: number;
  collectCount?: number;
  commentCount?: number;
  publishTime: string;
  tagList?: ArticleTag[];
  // 兼容旧字段
  articleTags?: ArticleTag[];
  tags?: ArticleTag[];
  // 交互状态
  isLiked?: boolean;
  isCollected?: boolean;
  likeTime?: string;
  collectTime?: string;
  [key: string]: any;
}

// 点赞的文章
export interface LikedArticle extends ArticleCardItem {
  likeTime: string;
}

// 收藏的文章
export interface CollectedArticle extends ArticleCardItem {
  collectTime: string;
}

// 关注的用户
export interface FollowingUser {
  userId: number;
  nickName: string;
  avatar: string;
  articleCount: number;
  followerCount: number;
  followTime: string;
  isFollowed: boolean;
}

// 粉丝用户
export interface FollowerUser {
  userId: number;
  nickName: string;
  avatar: string;
  articleCount: number;
  followerCount: number;
  followTime: string;
  isFollowBack: boolean;
}

// 分页参数
export interface PageParams {
  page?: number;
  size?: number;
}

// 分页响应
export interface PageResponse<T> {
  records: T[];
  total: number;
  size: number;
  current: number;
  pages: number;
}
